package com.meatball.game.data

import com.alibaba.fastjson2.annotation.JSONField
import io.swagger.v3.oas.annotations.media.Schema

/**
 * TODO 玩家信息数据类
 *
 * @property id 玩家ID
 * @property name 玩家名称
 * @property avatar 玩家头像
 * @property isAi 是否是AI
 */
@Schema(description = "玩家信息数据类")
data class Player (
        @Schema(description = "玩家ID", example = "5bc67f71428b468681c0a988ee9c8e0e")
        val id: String = "",
        @Schema(description = "玩家名称", example = "李明")
        val name: String = "",
        @Schema(description = "玩家头像", example = "https://meatball.org.cn:8000/images/2024/03/07/v2-6b9ade8a3dce476f0c56e9a52aa89d8b_r.jpg")
        val avatar: String = "",
        @Schema(description = "是否是AI(true/false)", example = "true")
        @get:JSONField(name = "is_ai")
        @set:JSONField(name = "is_ai")
        var isAi: Boolean = false,
        @Schema(description = "游戏角色", example = "")
        @get:JSONField(name = "game_role")
        @set:JSONField(name = "game_role")
        var gameRole: String = "",
        @Schema(description = "AI名称", example = "李翠花")
        var aiName: String = ""
)

/**
 * TODO 开始游戏数据类
 *
 * @property id 房间ID
 * @property gameType 游戏类型
 * @property players 玩家集合
 */
data class StartGame(
        val id: String = "",
        @get:JSONField(name = "game_type")
        @set:JSONField(name = "game_type")
        var gameType: String = "",
        val players: List<Player> = mutableListOf()
)

/**
 * TODO 开始游戏返回数据
 *
 * @property code
 * @property msg
 */
data class StartGameResponse (
        var code: Int = 0,
        var msg: String = "",
        var results: StartGame
)